<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta content="yes" name="apple-mobile-web-app-capable">
    <meta content="yes" name="apple-touch-fullscreen">
    <meta content="telephone=no,email=no" name="format-detection">
    <script src="http://g.tbcdn.cn/mtb/lib-flexible/0.3.4/??flexible_css.js,flexible.js"></script>
    <link rel="stylesheet" href="../css/style.css"/>
    <script src="http://code.jquery.com/jquery-2.1.4.min.js"></script>
    <script src="../js/fastclick.js"></script>
    <script>
        window.addEventListener('load', function () {
            FastClick.attach(document.body);
        }, false);
    </script>
    <style type="text/css">
        .content {
            background: url(../images/background.png) no-repeat;
            background-size: cover;
        }
        .referral {
            margin-top: 2.66rem;
        }
        .avator {
            margin: 0 auto;
            width: 2.53rem;
            height: 2.53rem;
            border-radius: 50%;
            overflow: hidden;
        }
        img {
            display: block;
            width: 100%;
            height: 100%;
        }
        .tip {
            margin-top: .24rem;
            margin-bottom: 1rem;
            font-size: .54rem;
            height: .8rem;
            line-height: .8rem;
            text-align: center;
            color: #e0c84f;
        }
        .button-group {
            margin: 0 auto;
            width: 5.2rem;
        }
        .button {
            height: 1.28rem;
            line-height: 1.28rem;
            border-radius: .64rem;
            font-size: .54rem;
            color: #fff;
            text-align: center;
        }
        .button:first-child {
            margin-bottom: .35rem;
        }
        #btn1 {
            background: #e9d361;
        }
        #btn2 {
            background: #e1675c;
        }
        .introduction {
            font-size: .7rem;
            color: #E26C60;
            margin-top: 1.23rem;
            text-align: center;
        }
    </style>
</head>
<body>
<div class="content">
    <div class="referral">
        <div class="avator">
            <img src="../images/avator.png" alt=""/>
        </div>
        <div class="tip"><span></span>推荐你使用秒升软件</div>
    </div>
    <div class="button-group">
        <div id="btn1" class="button">我要注册</div>
       <!-- <div id="btn2" class="button">立即下载</div>-->
	<div style="text-align:center" >微信浏览器中，点击右上角打开浏览器，方可下载!</div>
    </div>
    <div class="introduction">奇妙消费之旅</div>
</div>
<div class="toolTip"></div>
<script>
    var arr=window.location.href.split('?')[1].split('&');
    sessionStorage['invitedCode']=arr[1].split('=')[1];
    sessionStorage['img']=arr[0].split('=')[1];
    var img=new Image();
    img.src=arr[0].split('=')[1];
    img.onload=function(){
        $('.avator img').attr('src', img.src)
    };
    $('#btn1').on('click',function(){
        location.href='register.html'
    });

    $('#btn2').on('click',function(){
        var isAndroid=(/android/gi).test(navigator.appVersion), isIOS=(/iphone|ipad/gi).test(navigator.appVersion);
        var url="", weixin="";
        /**
         * 具体下载信息
         * */
        function executeDownload(vid,type){
            if(type==1){
                setTimeout(function(){
                    window.open("https://itunes.apple.com/us/app/%E7%A7%92%E5%8D%87/id1292121494?l=zh&ls=1&mt=8");
                },500);

            }else if(type==2){

            }else if(type==3){
                var addr='http://openbox.mobilem.360.cn/index/d/sid/3887730';
                if(addr){
                    setTimeout(function(){
                        document.location.href=url+addr+weixin;
                    },500);
                }else{
                    bootstrap.alert('该版本暂未发布');
                    return false;
                }
            }else{
            }

        }


        jQuery(function($){
            if(is_weixin()){
                showGuide();
            }else{
                startDownload();
            }
        });
        /**
         * 判断是否是微信浏览器
         * */
        function is_weixin(){
            var ua=navigator.userAgent.toLowerCase();
            if(ua.match(/MicroMessenger/i)=="micromessenger"){
                return true;
            }else{
                return false;
            }
        }
        /**
         * 下载信息
         * */
        function startDownload(){
            if(isIOS){
                $("#id_wrap").addClass('cid_wrap');
                executeDownload('15',1);
            }else if(isAndroid){
                $("#id_wrap").addClass('cid_wrap');
                executeDownload('8',3);
            }else{
                folWrap();
            }
        }
        /**
         * 显示提示页面
         * */
        function showGuide(){
            if(isIOS){
                var html=$("#ios_install_guide").html();
                $("#id_wrap").addClass('cid_wrap');
                $("#container").html(html);
            }else if(isAndroid){
                var html=$("#android_install_guide").html();
                $("#id_wrap").addClass('cid_wrap');
                $("#container").html(html);
            }else{
                folWrap();
            }
        }
        /**
         * 二维码扫描
         */
        function folWrap(){

        }
        /**
         *  统计版本下载量信息
         */

        /**
         *  获取URL中参数的值
         */
        function getQueryString(name){
            var reg=new RegExp("(^|&)"+name+"=([^&]*)(&|$)","i");
            var r=window.location.search.substr(1).match(reg);
            if(r!=null) return unescape(r[2]);
            return "";
        }

    });


</script>
</body>
</html>
